<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8" />
	<title>测试登陆</title>
</head>
<body>
	<script src="../js/mui.min.js"></script>
	<script type="text/javascript" src="../js/jquery-3.2.1.min.js" ></script>
	<script>
	
		mui.ajax('http://igo.vrdete.com/api/wechat/authorize',{
			data:{},
			dataType:'JSON',//服务器返回json格式数据
			type:'post',//HTTP请求类型
			timeout:10000,//超时时间设置为10秒；
			headers:{'Content-Type':'application/json'},	              
			success:function(data){
				alert(JSON.stringify(data));
				console.log("in mui.ajax type post");
				alert("你已取得Appid:"+data.dataResultObj.AppId);

				appid = data.dataResultObj.AppId;

 window.location.href ='https://open.weixin.qq.com/connect/oauth2/authorize?appid='+appid+'&redirect_uri='+tourl+'&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect '

				console.log(data);
				
			},
			error:function(xhr,type,errorThrown){
				//异常处理；
				alert(type);
			}

		});	
	</script>
</body>
</html>